using Godot;
using System;

namespace PaintAWorld.Gd
{
	public partial class ConstructionInstance : StaticBody3D
	{
		[Export]
		public VoxModel model;

		[Export]
		public CollisionShape3D shape;
		[Export]
		public VoxelModelInstance modelInstance;

		public override void _Ready()
		{
			var voxelModel = model.ToVoxelModel();
			var voxelSize = 1.0f / voxelModel.Width;
			shape.Position = new(0.5f, 0.5f, 0.5f);
			modelInstance.Regen(voxelModel, Vector3.Zero, voxelSize);
			
		}
	}

}